package com.nbsaas.boot.order.data.entity;

import com.nbsaas.boot.code.annotation.FieldConvert;
import com.nbsaas.boot.code.annotation.FormAnnotation;
import com.nbsaas.boot.jpa.data.entity.LongEntity;
import lombok.Data;
import org.hibernate.annotations.Comment;

import javax.persistence.*;
import java.util.Date;

@org.hibernate.annotations.Table(appliesTo = "bs_order_log", comment = "订单日志")
@Data
@FormAnnotation(title = "订单日志")
@Entity
@Table(name = "bs_order_log")
public class OrderLog extends LongEntity {

    @JoinColumn(name = "order_id")
    @Comment("订单id")
    @FieldConvert
    @ManyToOne(fetch = FetchType.LAZY)
    private Order order;

    @Comment("用户id")
    private Long userId;

    @Comment("用户姓名")
    private String userName;


    @Comment("修改内容")
    private String note;

    /**
     * 添加时间
     */
    @Comment("添加时间")
    private Date addDate;

    /**
     * 最新修改时间
     */
    @Comment("最新修改时间")
    private Date lastDate;
}
